<?php
/**
 *	KLF Framework
 *
 *	Written by Kristian Oye <kristianoye@gmail.com> on Nov 19, 2011
 *	Copyright (C) 2010-2011
 */
namespace KLF\System\Cache
{
	/**
	 * A common interface that must be implemented by all framework
	 * cache implementations.
	 * 
	 * @author kristian
	 * @since 0.1
	 * @version 0.1
	 * @see KCache
	 */
	interface ICache
	{
		/**
		 * Adds a new value to the cache.
		 * 
		 * @param string $key
		 * @param mixed $val
		 * @param integer $expires
		 * @param integer $flag
		 * 
		 * @return boolean True if successful.
		 */
		function AddValue($key, $val, $expires=0, $flag = NULL);
		
		/**
		 * Deletes one or more values from the cache.
		 * 
		 * Example: $cache->DeleteValues('key1', 'key2', ...)
		 * 
		 * @return ICache Returns a reference to the cache object.
		 */
		function DeleteValues();
		
		/**
		 * Clears all of the values from the cache.
		 * 
		 * @return ICache Returns a reference to the cache object.
		 */
		function Flush();
		
		/**
		 * Returns a single value from the cache.
		 * 
		 * @param string $key
		 * @return mixed
		 */
		function GetValue($key);
		
		/**
		 * Returns one or more values from the cache.
		 */
		function GetValues();
		
		/**
		 * Initialize the cache instance.
		 */
		function Initialize();
		
		/**
		 * Set a value into the cache.
		 * 
		 * @param string $key
		 * @param ICacheable $val
		 * @param integer $expires
		 * 
		 * @return ICache Returns a reference to the cache object.
		 */
		function SetValue($key, $val, $expires = 0);
	}
}
